import request from '@/utils/request'

export function getList(data) {
  return request({
    url: '/goods/info/getGoodsList',
    method: 'post',
    data,
  })
}

export function getGoodsDetail(id) {
  return request({
    url: '/goods/info/getGoodsInfo/' + id,
    method: 'get'
  })
}

export function updateGoodsInfo(data) {
  return request({
    url: '/goods/info/updateGoodsInfo',
    method: 'post',
    data
  })
}

export function addGoodsInfo(data) {
  return request({
    url: '/goods/info/addGoodsInfo',
    method: 'post',
    data
  })
}

//不分页的根据商品名称查询所有已上架的商品
export function searchGoodsByName(goodsName) {
  return request({
    url: '/goods/info/list?goodsName=' + goodsName,
    method: 'get'
  })
}